|
|
|
|
|
|
|
The JOIN clause is a very powerful optional SQL clause. Remember when you learned how to link two tables together using WHERE table1.column1 = table2.column1? The only problem with using the WHERE clause is that the result set is not updateable. What if you need to create an updateable result set that contains columns from more than one table? You use JOIN. |
|
|
|
|
|
|
|
|
There are three types of JOIN clauses in Microsoft Access Jet SQL: |
|
|
|
|
|
|
|
|
The following sections describe each form of JOIN and how it is used in your programs. |
|
|
|
|
|
|
|
|
The INNER JOIN can be used to create a result set that contains only those records that have an exact match in both tables. Enter and execute the following SQL statement (see Figure 8.28): |
|
|
|
|
|
|
|
|
SELECT PublisherComments.Comments,
Publishers.Name, Publishers.StateProv
FROM PublisherComments INNER JOIN Publishers
ON PublisherComments.PubID = Publishers.PubID |
|
|
|
|
|
|
|
|
Figure 8.28.
Using the INNER JOIN SQL clause. |
|
|
|
|
|